package com.hfdg.prototype.base.commponet;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Component
public class StartExplorerAfterStarted {
    @Value("${sea.url}")
    String url;
    @Value("${sea.open}")
    boolean open;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public void openExplorerAfterStarted(){
        try {
            if(open){
                Runtime.getRuntime().exec("cmd   /c   start   "+url);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
